﻿/*
 * Created by SharpDevelop.
 * Author: Taranu Bogdan
 * Date: 5/4/2012
 * Time: 10:06 AM
 */
using System;
using System.Text;

namespace SensorClient
{
    /// <summary>
    /// Argument class for a SensorReceived Event
    /// </summary>
    public class SensorsReceivedArgs : EventArgs
    {
        #region Members
        /// <summary>
        /// The byte package who is received
        /// </summary>
        private readonly byte[] package;
        #endregion

        #region Constructors
        /// <summary>
        /// Constructor for a SensorReceivedArgs object
        /// </summary>
        /// <param name="package">The package containing sensor information</param>
        public SensorsReceivedArgs(byte[] package)
        {
            //Creates a shallow copy of package
            this.package = package;
        }
        #endregion

        #region Methods and Properties
        /// <summary>
        /// Converts a package to a string
        /// </summary>
        /// <returns>A string containing the byte values of the package</returns>
        public override string ToString()
        {
            string result = "";
            for (int i = 0; i < package.Length; i++)
            {
                result += package[i] + " ";
            }
            return result;
        }

        /// <summary>
        /// Returns a reference to the package
        /// </summary>
        public byte[] Package
        {
            get
            {
                return package;
            }
        }
        #endregion
    }
}